﻿Imports System.Data.SqlClient
Public Class DF01_MR
    Inherits Conexion
    Dim cmd As New SqlCommand
    Public Function guardar(ByVal dts As Entidades.EF01Vehiculo) As Boolean
        Try
            conectado()
            cmd = New SqlCommand("sp_guardar_F01MR")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@certifica", dts.certificaa)
            cmd.Parameters.AddWithValue("apenomdentit", dts.apenomdentitt)
            cmd.Parameters.AddWithValue("@dnitit", dts.dnititt)
            cmd.Parameters.AddWithValue("@letit", dts.letitt)
            cmd.Parameters.AddWithValue("@lctit", dts.lctitt)
            cmd.Parameters.AddWithValue("@citit", dts.cititt)
            cmd.Parameters.AddWithValue("@pasaportetit", dts.pasaportetitt)
            cmd.Parameters.AddWithValue("@numtit", dts.numtitt)
            cmd.Parameters.AddWithValue("@autoridadtit", dts.autoridatitt)
            cmd.Parameters.AddWithValue("@apenomdencond", dts.apenomdencondd)
            cmd.Parameters.AddWithValue("@dnicond", dts.dnicondd)
            cmd.Parameters.AddWithValue("@lecond", dts.lecondd)
            cmd.Parameters.AddWithValue("@lccond", dts.lccondd)
            cmd.Parameters.AddWithValue("@cicond", dts.cicondd)
            cmd.Parameters.AddWithValue("@pasaportecond", dts.pasaportecondd)
            cmd.Parameters.AddWithValue("@numcond", dts.numcondd)
            cmd.Parameters.AddWithValue("@autoridadcond", dts.autoridadcondd)
            cmd.Parameters.AddWithValue("@observaciones", dts.observacioness)
            cmd.Parameters.AddWithValue("@lugar", dts.lugarr)
            cmd.Parameters.AddWithValue("@fechadia", dts.fechadiaa)
            cmd.Parameters.AddWithValue("@fechames", dts.fechamess)
            cmd.Parameters.AddWithValue("@fechaaño", dts.fechaañoo)
            cmd.Parameters.AddWithValue("@autorizado", dts.autorizadoo)
            cmd.Parameters.AddWithValue("@tipodocnum", dts.tipodocnumm)
            cmd.Parameters.AddWithValue("@apenom", dts.apenomm)
            cmd.Parameters.AddWithValue("@doc", dts.docc)
            cmd.Parameters.AddWithValue("@caracter", dts.caracterr)
            If cmd.ExecuteNonQuery Then
                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        desconectado()
    End Function

    Public Function editar(ByVal dts As Entidades.EF01Vehiculo) As Boolean
        Try
            conectado()
            cmd = New SqlCommand("sp_editar_F01MR")
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Connection = cnn
            cmd.Parameters.AddWithValue("@certifica", dts.certificaa)
            cmd.Parameters.AddWithValue("apenomdentit", dts.apenomdentitt)
            cmd.Parameters.AddWithValue("@dnitit", dts.dnititt)
            cmd.Parameters.AddWithValue("@letit", dts.letitt)
            cmd.Parameters.AddWithValue("@lctit", dts.lctitt)
            cmd.Parameters.AddWithValue("@citit", dts.cititt)
            cmd.Parameters.AddWithValue("@pasaportetit", dts.pasaportetitt)
            cmd.Parameters.AddWithValue("@numtit", dts.numtitt)
            cmd.Parameters.AddWithValue("@autoridadtit", dts.autoridatitt)
            cmd.Parameters.AddWithValue("@apenomdencond", dts.apenomdencondd)
            cmd.Parameters.AddWithValue("@dnicond", dts.dnicondd)
            cmd.Parameters.AddWithValue("@lecond", dts.lecondd)
            cmd.Parameters.AddWithValue("@lccond", dts.lccondd)
            cmd.Parameters.AddWithValue("@cicond", dts.cicondd)
            cmd.Parameters.AddWithValue("@pasaportecond", dts.pasaportecondd)
            cmd.Parameters.AddWithValue("@numcond", dts.numcondd)
            cmd.Parameters.AddWithValue("@autoridadcond", dts.autoridadcondd)
            cmd.Parameters.AddWithValue("@observaciones", dts.observacioness)
            cmd.Parameters.AddWithValue("@lugar", dts.lugarr)
            cmd.Parameters.AddWithValue("@fechadia", dts.fechadiaa)
            cmd.Parameters.AddWithValue("@fechames", dts.fechamess)
            cmd.Parameters.AddWithValue("@fechaaño", dts.fechaañoo)
            cmd.Parameters.AddWithValue("@autorizado", dts.autorizadoo)
            cmd.Parameters.AddWithValue("@tipodocnum", dts.tipodocnumm)
            cmd.Parameters.AddWithValue("@apenom", dts.apenomm)
            cmd.Parameters.AddWithValue("@doc", dts.docc)
            cmd.Parameters.AddWithValue("@caracter", dts.caracterr)
            If cmd.ExecuteNonQuery Then
                Return True
            Else
                Return False
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        desconectado()
    End Function
End Class
